// 节流
export function reduce(func, wait) {
  let previous = null;
  return function() {
      const context = this
      const args = arguments
      if (!previous) {
          previous = setTimeout(() => {
              previous = null
              func.apply(context, args)
          }, wait)
      }
  }
}
